using System;
using NUnit.Framework;
using TypeMock;

namespace ValidationFramework.Tests
{


	[TestFixture]
	public class CompareValidationHelperTest : BaseTypeMock
	{

		[Test]
		public void CompareGeneric()
		{
			using (var recordExpectations = RecorderManager.StartRecording())
			{
				recordExpectations.ExpectAndReturn(CompareValidationHelper.CheckCompareResult(0, CompareOperator.Equal), true);
			}
			CompareValidationHelper.Compare(3, 3, CompareOperator.Equal);
		}

		[Test]
		public void CompareNonGeneric()
		{
			using (var recordExpectations = RecorderManager.StartRecording())
			{
				recordExpectations.ExpectAndReturn(CompareValidationHelper.CheckCompareResult(0, CompareOperator.Equal), true);
			}
			object left = 3;
			object right = 3;
			CompareValidationHelper.Compare(left, right, CompareOperator.Equal);
		}

		[Test]
		[ExpectedException(typeof(InvalidOperationException))]
		public void ExceptionInvalidCompareOperator()
		{
			CompareValidationHelper.CheckCompareResult(0, (CompareOperator)12);
		}

	}
}